Pants.util = {};

// -- Pants.util.Admin ---------------------------------------------------------
Pants.util.Admin = {
  formatPageName: function (e) {
    var pageName = YAHOO.util.Dom.get('pageName'),
        newName  = '';
    
    newName = pageName.value.replace(/\s+/, '-');
    newName = newName.replace(/[^0-9A-Za-z_-]/, '');
    
    pageName.value = newName;
  }
};

// -- Register Event Handlers --------------------------------------------------
YAHOO.util.Event.addListener('pageName', 'keyup',
    Pants.util.Admin.formatPageName);

